package com.youlv.yl.entity.network;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @author fenghe
 * @date 2022/1/13 20:34
 */
@Data
@TableName("u_ossLog")
@NoArgsConstructor
public class OssLog {

    @TableId(type = IdType.AUTO)
    private Long id;

    /** 储存空间名称*/
    @TableField("bucket")
    private String bucket;

    /** 类型：1.图片，2.视频*/
    @TableField("type")
    private String type;

    /** 对象名*/
    @TableField("objName")
    private String objName;

    /** 访问地址*/
    @TableField("preUrl")
    private String preUrl;

    @TableField("ctime")
    private Date ctime;

    /** 访问地址失效时间*/
    @TableField("etime")
    private Date etime;

    public OssLog(String bucket, String type, String objName, String preUrl, Date etime) {
        this.bucket = bucket;
        this.type = type;
        this.objName = objName;
        this.preUrl = preUrl;
        this.ctime = new Date();
        this.etime = etime;
    }
}
